#include <QApplication>
#include <QIODevice>
#include <QFile>
#include <QDataStream>
#include <QtDebug>

int main(int argc, char *argv[])
{
	QApplication app(argc, argv);

	QFile file("123.txt");
	file.open(QIODevice::WriteOnly);
	QDataStream out(&file);
	out<<"hello world\n";
	file.close();

	file.open(QIODevice::ReadOnly);
	QDataStream in(&file);
	QString str;
	in>>str;
	qDebug()<<str;
	file.close();

	return app.exec();
}
